/*
 * @Description:
 * @Author: Zzt
 * @Date: 2022-10-09 14:40:17
 * @LastEditTime: 2022-10-24 11:46:37
 */
import { Button, Descriptions, Tag } from 'antd';
import styles from '../styles/result.module.scss';
import classNames from 'classnames/bind';
import { findIndex } from 'lodash-es';
const cx = classNames.bind(styles);

const EEPError = (props: any) => {
  const { detectionResultEnvironment } = props;
  return (
    <div className={cx('result-show')}>
      <Descriptions
        title={'检测失败原因'}
        extra={<Button type="primary">导出报告</Button>}
        labelStyle={{ fontWeight: 'bold' }}
      >
        {detectionResultEnvironment.map((item: any) => (
          <>
            <Descriptions.Item
              label={item.name}
              labelStyle={{ fontWeight: 'bold' }}
              key={item}
              span={4}
            >
              {/*  */}
            </Descriptions.Item>
            {item.items.map((iitem: any) => (
              <Descriptions.Item
                label={`${item.items.findIndex((item: any) => item === iitem) + 1}.失败项${
                  item.items.findIndex((item: any) => item === iitem) + 1
                }`}
                labelStyle={{ fontWeight: 'bold' }}
                key={item.items.findIndex((item: any) => item === iitem) + 1}
                span={4}
              >
                {iitem}
              </Descriptions.Item>
            ))}
          </>
        ))}
      </Descriptions>
    </div>
  );
};
export default EEPError;
